import ajax from '../util/request'
import getAjax from '../util/req2'
import putAjax from '../util/putRequest'
import resetsAjax from '../util/resetRequest'

// 登录
export const loginAjax = (params) => ajax({
    method:'post',
    url:'/login',
    params,
    headtype:'form'
}) 
// 用户列表
export const userAjax = (params) => ajax({
    method:'get',
    url:'/users',
    params,
    headtype:'form'
}) 
// 根据id搜索用户
export const trollAjax = (params) => getAjax({
    method:'get',
    url:'/users',
    params,
    headtype:'form'
}) 

// 改变用户状态
export const staAjax = (params) => putAjax({
    method:'put',
    url:'/users',
    params,
    headtype:'form'
}) 

// 删除单个用户
export const delAjax = (params) => putAjax({
    method:'delete',
    url:'/users',
    params,
    headtype:'form'
}) 

// 添加用户
export const addAjax = (params) => ajax({
    method:'post',
    url:'/users',
    params,
    headtype:'form'
}) 

// 修改接口
export const resetAjax = (params) => resetsAjax({
    method:'put',
    url:'/users',
    params,
    headtype:'form'
}) 
